package springboot.example.springboot;

import java.util.Arrays;

@FunctionalInterface
interface A {
    void test(int b);
}

interface B {
    int test(int a,int b);

}

public class Java8 {

    public int getNum(B a){
        return a.test(2,3);
    }

    public void getA(A a){

    }

    public static void main(String[] args) {
        A a = (s) -> System.out.println(111);
        a.test(2);

        B b = (x,y) -> {
            return x+y;
        };

        B b1 = (x,y) -> x+y;
        System.out.println(b1.test(2,3));
        int test = b.test(1, 2);
        System.out.println(test);


        Java8 java8 = new Java8();
        java8.getNum((a1, b2) -> a1 + b2);

        A A1 = System.out::println;
        A1.test(222);


        Asort sort = Arrays::sort;
        int [] c = new int[]{2,4,1,6,5};
        sort.Asort(c);
        System.out.println(Arrays.toString(c));

    }

    interface Asort{
        void Asort(int[] b);
    }



}
